/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.makcro.sms.services.chat.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 * 
 * @author makcro
 */
@Entity
@Table(name = "bulkgroupitem")
@NamedQueries({ @NamedQuery(name = "BulkGroupItem.findAll", query = "SELECT b FROM BulkGroupItem b"),
		@NamedQuery(name = "BulkGroupItem.findByBulkGroup", query = "SELECT b FROM BulkGroupItem b where b.bulkGroup = :group"),
		@NamedQuery(name = "BulkGroupItem.findByBulkGroupAndItem", query = "SELECT b FROM BulkGroupItem b where b.bulkGroup = :group and b.id = :itemId"),
		@NamedQuery(name = "BulkGroupItem.findByPhonenumber", query = "SELECT b FROM BulkGroupItem b WHERE b.phoneNumber = :phoneNumber") })
public class BulkGroupItem implements Serializable {
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Basic(optional = false)
	@Column(name = "Id", nullable = false)
	private Integer id;
	@Column(name = "PhoneNumber", length = 128)
	private String phoneNumber;
	@Column(name = "Note", length = 1024)
	private String note;
	@Column(name = "Disabled")
	private boolean disabled;
	@JoinColumn(name = "BulkGroupId", referencedColumnName = "Id")
	@ManyToOne
	private BulkGroup bulkGroup;

	public BulkGroupItem() {
	}

	public BulkGroupItem(Integer id) {
		this.id = id;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public BulkGroup getBulkGroup() {
		return bulkGroup;
	}

	public void setBulkGroup(BulkGroup bulkGroupId) {
		this.bulkGroup = bulkGroupId;
	}

	public boolean isDisabled() {
		return disabled;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		if (!(object instanceof BulkGroupItem)) {
			return false;
		}
		BulkGroupItem other = (BulkGroupItem) object;
		if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "smschatmodel.BulkGroupItem[ id=" + id + " ]";
	}

}
